---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-8-3a573ce9d75f> in <module>()
----> 1 show(dashboard.hours())
~\Dropbox\grantThornton\projects\employment_dashboard\src\widgets.py in hours(self)
155
156 def hours(self):
--> 157 by_industry = HoursByIndustryTables(self.conn)()
158
159 notes = Div(
~\Dropbox\grantThornton\projects\employment_dashboard\src\by_industry.py in __call__(self, force)
63
64 def __call__(self, force: bool = False):
---> 65 if not self._tbls or force: self.construct_tables()
66 if not self.widget or force: self.construct_widget()
67
~\Dropbox\grantThornton\projects\employment_dashboard\src\by_industry.py in construct_tables(self)
386 print(su, hrs, trans, wgt, wkg, seas)
387 print(dd.head(1))
--> 388 raise e
389
390 def _get_caption(self, su, hrs, wkg, trans, wgt, seas):
~\Dropbox\grantThornton\projects\employment_dashboard\src\by_industry.py in construct_tables(self)
381 seas)] = self._construct_one_table(
382 dd, trans, wgt, wkg, seas, caption,
--> 383 stat_fmt
384 )
385 except Exception as e:
~\Dropbox\grantThornton\projects\employment_dashboard\src\by_industry.py in _construct_one_table(self, dd, trans, wgt, wkg, seas, caption, stat_fmt)
177 # Apply styles
178 cmap = utils.get_pos_neg_colormap(
--> 179 dd.values[:, :-1], attr='background-color'
180 )
181
~\Dropbox\grantThornton\projects\employment_dashboard\src\utils.py in get_pos_neg_colormap(v, n_colors, attr)
41 mx = abs(v).max()
42 if v.max() == mx:
---> 43 p_cuts = np.percentile(v[v > 0], np.linspace(0, 100, n_colors))
44 n_cuts = -np.flip(p_cuts)
45 else:
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\function_base.py in percentile(a, q, axis, out, overwrite_input, interpolation, keepdims)
3538 raise ValueError("Percentiles must be in the range [0, 100]")
3539 return _quantile_unchecked(
-> 3540 a, q, axis, out, overwrite_input, interpolation, keepdims)
3541
3542
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\function_base.py in _quantile_unchecked(a, q, axis, out, overwrite_input, interpolation, keepdims)
3650 r, k = _ureduce(a, func=_quantile_ureduce_func, q=q, axis=axis, out=out,
3651 overwrite_input=overwrite_input,
-> 3652 interpolation=interpolation)
3653 if keepdims:
3654 return r.reshape(q.shape + k)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\function_base.py in _ureduce(a, func, **kwargs)
3248 keepdim = (1,) * a.ndim
3249
-> 3250 r = func(a, **kwargs)
3251 return r, keepdim
3252
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\function_base.py in _quantile_ureduce_func(a, q, axis, out, overwrite_input, interpolation, keepdims)
3765 n = np.isnan(ap[-1:, ...])
3766
-> 3767 x1 = take(ap, indices_below, axis=axis) * weights_below
3768 x2 = take(ap, indices_above, axis=axis) * weights_above
3769
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\fromnumeric.py in take(a, indices, axis, out, mode)
179 [5, 7]])
180 """
--> 181 return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
182
183
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
49 def _wrapfunc(obj, method, *args, **kwds):
50 try:
---> 51 return getattr(obj, method)(*args, **kwds)
52
53 # An AttributeError occurs if the object does not have
IndexError: cannot do a non-empty take from an empty axes.